package cn.xiehang.SoundSight;

public class Product {
    private int id;
    private String name;
    private double price;
    private Object imageUrl; // 改为Object类型，可以接受String(url)或Integer(resId)
    private int quantity;
    private int buyCount;
    private String introduction;
    private boolean isSelected;



    //商品主界面调用的方法
    public Product(int id, String name, double price, Object imageUrl, String introduction,int quantity) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.imageUrl = imageUrl;
        this.introduction = introduction;
        this.quantity = quantity;
        buyCount = 0;
    }
    //商品主界面调用的方法
    public Product(int id, String name, double price, Object imageUrl, String introduction) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.imageUrl = imageUrl;
        this.introduction = introduction;
        buyCount = 0;
    }

    // getter和setter方法
    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public int getBuyCount() {
        return buyCount;
    }

    public double getPrice() {
        return price;
    }

    public Object getImageUrl() {
        return imageUrl;
    }

    public String getIntroduction() {
        return introduction;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public void setBuyCount(int buyCount) {
        this.buyCount = buyCount;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }
}